﻿using System;

namespace ExFlash
{
    /// <summary>
    /// Provides formatting for SWF serialization and deserialization.
    /// </summary>
    public interface ISwfSerializable
    {
        /// <summary>
        /// Deserializes the data from the given array into an object.
        /// </summary>
        /// <param name="reader">Byte Array containing the serialized data.</param>
        void SwfDeserialize(BinaryBitReader reader);

        /// <summary>
        /// Serializes the object into the given array.
        /// </summary>
        /// <param name="arr">Byte Array to contain the Data.</param>
        /// <param name="offset">Byte offset of the object. Changes after execution to the byte after the object 
        /// (in the swf format some data types have changing sizes.</param>
        void SwfSerialize(Byte[] arr, ref int offset);
    }
}
